<html>
	<head>

		<script type="text/javascript">

		function extract(html)
		{
			html = html.replace(/<a href=/g,"[URL=");	
			html = html.replace(/">/g,"]");	
			html = html.replace(/="/g,"=");	
			html = html.replace(/<\/a>/g,"[URL]");			
			return html;
		};

		function onClick()
		{
			  var html = '<p>Please visit <a href="http://academy.telerik.com">our site</a> to choose a training course. Also visit <a href="www.devbg.org">our forum</a> to discuss the courses.</p>';
			  	var output = document.getElementById('output');
		        var p = document.createElement("p");
				var html = document.createTextNode(extract(html));
				p.appendChild(html);
				output.appendChild(p);		     
		};
		</script>
		<title></title>
	</head>
	<body>
		
		<p>
			&lt;p&gt;Please visit &lt;a href="http:&#47;&#47;academy.telerik.com"&gt;our site&lt;&#47;a&gt; to choose a training course. Also visit &lt;a href="www.devbg.org"&gt;our forum&lt;&#47;a&gt; to discuss the courses.&lt;&#47;p&gt;;
		</p>
		<button onclick="onClick()" id="buttonOne">Replace</button>
		<p>
			Output
		</p>
		<div id="output"></div>
	</body>
</html>